package service.impl;

import bean.News;
import dao.INewsDao;


import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import service.INewsService;

import javax.annotation.Resource;
import java.util.List;
@Service
@Transactional
public class NewsServiceImpl implements INewsService {
    @Resource
    private INewsDao iNewsDao;

    @Override
    public List<News> queryAll() {
        return iNewsDao.queryAll();
    }

    @Override
    public News queryById(Integer nid) {
        return iNewsDao.queryById(nid);
    }

    @Override
    public void add(News news){iNewsDao.add(news);
    }

    @Override
    public void update(News news) {

        iNewsDao.update(news);
    }

    @Override
    public void delete(News news) {
        iNewsDao.delete(news);
    }
}
